﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace TetrisShape
{
    public class Block
    {
        private int x = 0;
        private int y = 0;

        public int X
        {
                      get { return x; }
            protected set { x = value; }
        }

        public int Y
        {
                      get { return y; }
            protected set { y = value; }
        }

        public Block(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
        public Block()
        { }


        public void DoStep(Shape sh)
        {
            foreach (Block bl in sh.ReturnBlock)
            {
                bl.Y += 1;
            }
            Thread.Sleep(300);
        }

        public override int GetHashCode()
        {
            int a = x % 10;
            int b = x % 100;
            int c = y % 10;
            int d = y % 100;
            if(a == 0 || c == 0)
            return b*d;
            return a * b * c * d;
        }
    }
}
